<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Isemir Details</f:facet>

		<rich:layout>
			<rich:layoutPanel position="left">	

		        <s:decorate id="isemirno" template="layout/display.xhtml">
		            <ui:define name="label">Isemirno</ui:define>
		            <h:outputText value="#{isemirHome.instance.isemirno}"/>
		        </s:decorate>
		
		        <s:decorate id="isemirtarihi" template="layout/display.xhtml">
		            <ui:define name="label">Isemirtarihi</ui:define>
		            <h:outputText value="#{isemirHome.instance.isemirtarihi}">
		                <s:convertDateTime type="date" dateStyle="short"/>
		            </h:outputText>
		        </s:decorate>
		        
				<s:decorate id="isemirurun" template="layout/display.xhtml">
		            <ui:define name="label">Ürün</ui:define>
		            <h:outputText value="#{isemirHome.instance.urun.adi}  #{isemirHome.instance.urun.ambalaj}"/>
		        </s:decorate>
		        
		        <s:decorate id="kalipeki" template="layout/display.xhtml">
		            <ui:define name="label">Kalipeki</ui:define>
		            <h:outputText value="#{isemirHome.instance.kalipeki}"/>
		        </s:decorate>
		
		        <s:decorate id="planlananadet" template="layout/display.xhtml">
		            <ui:define name="label">Planlananadet</ui:define>
		            <h:outputText value="#{isemirHome.instance.planlananadet}"/>
		        </s:decorate>
		                
		        <s:decorate id="aypaciklama" template="layout/display.xhtml">
		            <ui:define name="label">Aypaciklama</ui:define>
		            <h:outputText value="#{isemirHome.instance.aypaciklama}"/>
		        </s:decorate>
		
		        <s:decorate id="musterimarkalamasi" template="layout/display.xhtml">
		            <ui:define name="label">Musterimarkalamasi</ui:define>
		            <h:outputText value="#{isemirHome.instance.musterimarkalamasi}"/>
		        </s:decorate>
		        
		        <s:decorate id="formno" template="layout/display.xhtml">
		            <ui:define name="label">Formno</ui:define>
		            <h:outputText value="#{isemirHome.instance.formno}"/>
		        </s:decorate>

			</rich:layoutPanel>
			
			<rich:layoutPanel position="center">	

		        <s:decorate id="isletme" template="layout/display.xhtml">
		            <ui:define name="label">İşletme</ui:define>
		            <h:outputText value="#{isemirHome.instance.isletme.ad}"/>
		        </s:decorate>

		        <s:decorate id="siparisno" template="layout/display.xhtml">
		            <ui:define name="label">Siparisno</ui:define>
		            <h:outputText value="#{isemirHome.instance.siparisno}"/>
		        </s:decorate>
		
		        <s:decorate id="musteri" template="layout/display.xhtml">
		            <ui:define name="label">Müşteri</ui:define>
		            <h:outputText value="#{isemirHome.instance.musteri.ad}"/>
		        </s:decorate>

		        <s:decorate id="ulke" template="layout/display.xhtml">
		            <ui:define name="label">Ülke</ui:define>
		            <h:outputText value="#{isemirHome.instance.ulke.ad}"/>
		        </s:decorate>
		        
		        <s:decorate id="termintarihi" template="layout/display.xhtml">
		            <ui:define name="label">Termintarihi</ui:define>
		            <h:outputText value="#{isemirHome.instance.termintarihi}">
		                <s:convertDateTime type="date" dateStyle="short"/>
		            </h:outputText>
		        </s:decorate>
		
		        <s:decorate id="upkaciklama" template="layout/display.xhtml">
		            <ui:define name="label">Upkaciklama</ui:define>
		            <h:outputText value="#{isemirHome.instance.upkaciklama}"/>
		        </s:decorate>
		
		        <s:decorate id="uretimenotlar" template="layout/display.xhtml">
		            <ui:define name="label">Uretimenotlar</ui:define>
		            <h:outputText value="#{isemirHome.instance.uretimenotlar}"/>
		        </s:decorate>
			</rich:layoutPanel>
		</rich:layout>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/IsemirEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty isemirFrom ? 'IsemirList' : isemirFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab rendered="#{isemirHome.instance.firma == null || authenticator.isAdmin()}">
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Firma</h:panelGroup>
        </f:facet>
    <div class="association" id="firmaParent">

        <h:outputText value="There is no firma associated with this isemir."
                   rendered="#{isemirHome.instance.firma == null}"/>

        <rich:dataTable var="_firma"
                   value="#{isemirHome.instance.firma}"
                rendered="#{isemirHome.instance.firma != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="firmaTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_firma.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_firma.ad}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Adres</f:facet>
                <h:outputText value="#{_firma.adres}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Eposta</f:facet>
                <h:outputText value="#{_firma.eposta}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_firma.kod}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Mersisno</f:facet>
                <h:outputText value="#{_firma.mersisno}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Telefon</f:facet>
                <h:outputText value="#{_firma.telefon}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Vergino</f:facet>
                <h:outputText value="#{_firma.vergino}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Webadresi</f:facet>
                <h:outputText value="#{_firma.webadresi}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewfirma"
                     value="View"
                      view="/Firma.xhtml">
                    <f:param name="firmaId"
                           value="#{_firma.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemirbarkods</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemirbarkodsChildren">

        <h:outputText value="There are no isemirbarkods associated with this isemir."
                   rendered="#{empty isemirHome.isemirbarkods}"/>

        <rich:dataTable value="#{isemirHome.isemirbarkods}"
                       var="_isemirbarkod"
                  rendered="#{not empty isemirHome.isemirbarkods}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemirbarkodsTable">
            <rich:column sortBy="#{_isemirbarkod.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_isemirbarkod.id}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirbarkod.barkod}">
                <f:facet name="header">Barkod</f:facet>
                <h:outputText value="#{_isemirbarkod.barkod}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirbarkod.barkodturu}">
                <f:facet name="header">Barkodturu</f:facet>
                <h:outputText value="#{_isemirbarkod.barkodturu}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemirbarkod"
                     value="Select"
                      view="/Isemirbarkod.xhtml">
                    <f:param name="isemirbarkodId"
                            value="#{_isemirbarkod.id}"/>
                    <f:param name="isemirbarkodFrom" value="Isemir"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemirbarkod"
                view="/IsemirbarkodEdit.xhtml">
            <f:param name="isemirId"
                    value="#{isemirHome.instance.id}"/>
            <f:param name="isemirbarkodFrom" value="Isemir"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemiretuts</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemiretutsChildren">

        <h:outputText value="There are no isemiretuts associated with this isemir."
                   rendered="#{empty isemirHome.isemiretuts}"/>

        <rich:dataTable value="#{isemirHome.isemiretuts}"
                       var="_isemiretut"
                  rendered="#{not empty isemirHome.isemiretuts}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemiretutsTable">
            <rich:column sortBy="#{_isemiretut.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_isemiretut.id}"/>
            </rich:column>
            <rich:column sortBy="#{_isemiretut.tur}">
                <f:facet name="header">Tur</f:facet>
                <h:outputText value="#{_isemiretut.tur}"/>
            </rich:column>            
            <rich:column sortBy="#{_isemiretut.islemno}">
                <f:facet name="header">Islemno</f:facet>
                <h:outputText value="#{_isemiretut.islemno}"/>
            </rich:column>
			<rich:column sortBy="#{_isemiretut.urun.adi}">
                <f:facet name="header">Islemno</f:facet>
                <h:outputText value="#{_isemiretut.urun.adi} (#{_isemiretut.urun.kalip.kod} - #{_isemiretut.urun.ambalaj})"/>
            </rich:column>
            <rich:column sortBy="#{_isemiretut.kalipeki}">
                <f:facet name="header">Kalipeki</f:facet>
                <h:outputText value="#{_isemiretut.kalipeki}"/>
            </rich:column>
            <rich:column sortBy="#{_isemiretut.uruniciadet}">
                <f:facet name="header">Uruniciadet</f:facet>
                <h:outputText value="#{_isemiretut.uruniciadet}"/>
            </rich:column>            
            <rich:column sortBy="#{_isemiretut.kirik}">
                <f:facet name="header">Kirik</f:facet>
                <h:outputText value="#{_isemiretut.kirik}"/>
            </rich:column>
            <rich:column sortBy="#{_isemiretut.planfiyat}">
                <f:facet name="header">Planfiyat</f:facet>
                <h:outputText value="#{_isemiretut.planfiyat}"/>
            </rich:column>
            
            <rich:column sortBy="#{_isemiretut.parabirim.id}">
                <f:facet name="header">Para Birim</f:facet>
                <h:outputText value="#{_isemiretut.parabirim.kisaad} - #{_isemiretut.parabirim.ad}"/>
            </rich:column>
            
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemiretut"
                     value="Select"
                      view="/Isemiretut.xhtml">
                    <f:param name="isemiretutId"
                            value="#{_isemiretut.id}"/>
                    <f:param name="isemiretutFrom" value="Isemir"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemiretut"
                view="/IsemiretutEdit.xhtml">
            <f:param name="isemirId"
                    value="#{isemirHome.instance.id}"/>
            <f:param name="isemiretutFrom" value="Isemir"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab rendered="#{authenticator.isAdmin()}">
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemirharekets for isemirid</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemirhareketsForIsemiridChildren">

        <h:outputText value="There are no isemirhareketsForIsemirid associated with this isemir."
                   rendered="#{empty isemirHome.isemirhareketsForIsemirid}"/>

        <rich:dataTable value="#{isemirHome.isemirhareketsForIsemirid}"
                       var="_isemirhareket"
                  rendered="#{not empty isemirHome.isemirhareketsForIsemirid}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemirhareketsForIsemiridTable">
            <rich:column sortBy="#{_isemirhareket.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_isemirhareket.id}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirhareket.miktar}">
                <f:facet name="header">Miktar</f:facet>
                <h:outputText value="#{_isemirhareket.miktar}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemirhareket"
                     value="Select"
                      view="/Isemirhareket.xhtml">
                    <f:param name="isemirhareketId"
                            value="#{_isemirhareket.id}"/>
                    <f:param name="isemirhareketFrom" value="Isemir"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemirhareket"
                view="/IsemirhareketEdit.xhtml">
            <f:param name="isemirId"
                    value="#{isemirHome.instance.id}"/>
            <f:param name="isemirhareketFrom" value="Isemir"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab rendered="#{authenticator.isAdmin()}">
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemirharekets for virmanisemirid</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemirhareketsForVirmanisemiridChildren">

        <h:outputText value="There are no isemirhareketsForVirmanisemirid associated with this isemir."
                   rendered="#{empty isemirHome.isemirhareketsForVirmanisemirid}"/>

        <rich:dataTable value="#{isemirHome.isemirhareketsForVirmanisemirid}"
                       var="_isemirhareket"
                  rendered="#{not empty isemirHome.isemirhareketsForVirmanisemirid}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemirhareketsForVirmanisemiridTable">
            <rich:column sortBy="#{_isemirhareket.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_isemirhareket.id}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirhareket.miktar}">
                <f:facet name="header">Miktar</f:facet>
                <h:outputText value="#{_isemirhareket.miktar}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemirhareket"
                     value="Select"
                      view="/Isemirhareket.xhtml">
                    <f:param name="isemirhareketId"
                            value="#{_isemirhareket.id}"/>
                    <f:param name="isemirhareketFrom" value="Isemir"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemirhareket"
                view="/IsemirhareketEdit.xhtml">
            <f:param name="isemirId"
                    value="#{isemirHome.instance.id}"/>
            <f:param name="isemirhareketFrom" value="Isemir"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemiruruns</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemirurunsChildren">

        <h:outputText value="There are no isemiruruns associated with this isemir."
                   rendered="#{empty isemirHome.isemiruruns}"/>

        <rich:dataTable value="#{isemirHome.isemiruruns}"
                       var="_isemirurun"
                  rendered="#{not empty isemirHome.isemiruruns}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemirurunsTable">
            <rich:column sortBy="#{_isemirurun.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_isemirurun.id}"/>
            </rich:column>
			<rich:column sortBy="#{_isemirurun.toplammiktar}">
                <f:facet name="header">Ürün</f:facet>
                <h:outputText value="#{_isemirurun.urun.urunno} - #{_isemirurun.urun.adi}  #{_isemirurun.urun.ambalaj}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirurun.toplammiktar}">
                <f:facet name="header">Toplam Miktar</f:facet>
                <h:outputText value="#{_isemirurun.toplammiktar}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirurun.miktar}">
                <f:facet name="header">Bir Üründeki Miktar</f:facet>
                <h:outputText value="#{_isemirurun.miktar}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemirurun"
                     value="Select"
                      view="/Isemirurun.xhtml">
                    <f:param name="isemirurunId"
                            value="#{_isemirurun.id}"/>
                    <f:param name="isemirurunFrom" value="Isemir"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemirurun"
                view="/IsemirurunEdit.xhtml">
            <f:param name="isemirId"
                    value="#{isemirHome.instance.id}"/>
            <f:param name="isemirurunFrom" value="Isemir"/>
        </s:button>
    </div>
    </rich:tab>
    
        <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemirmalzemes</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemirmalzemesChildren">

        <h:outputText value="There are no isemirmalzemes associated with this isemir."
                   rendered="#{empty isemirHome.isemirmalzemes}"/>

        <rich:dataTable value="#{isemirHome.isemirmalzemes}"
                       var="_isemirmalzeme"
                  rendered="#{not empty isemirHome.isemirmalzemes}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemirmalzemesTable">
            <rich:column sortBy="#{_isemirmalzeme.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_isemirmalzeme.id}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirmalzeme.malzeme.kod}">
                <f:facet name="header">Malzeme</f:facet>
                <h:outputText value="#{_isemirmalzeme.malzeme.kod} - #{_isemirmalzeme.malzeme.ad}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirmalzeme.makskullanimmiktari}">
                <f:facet name="header">Max.Kul.Miktarı</f:facet>
                <h:outputText value="#{_isemirmalzeme.makskullanimmiktari}"/>
            </rich:column>
            <rich:column sortBy="#{_isemirmalzeme.miktar}">
                <f:facet name="header">Bir Üründeki Miktar</f:facet>
                <h:outputText value="#{_isemirmalzeme.miktar}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemirmalzeme"
                     value="Select"
                      view="/Isemirmalzeme.xhtml">
                    <f:param name="isemirmalzemeId"
                            value="#{_isemirmalzeme.id}"/>
                    <f:param name="isemirmalzemeFrom" value="Isemir"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemirmalzeme"
                view="/IsemirmalzemeEdit.xhtml">
            <f:param name="isemirId"
                    value="#{isemirHome.instance.id}"/>
            <f:param name="isemirmalzemeFrom" value="Isemir"/>
        </s:button>
    </div>
    </rich:tab>
    
    
</rich:tabPanel>
</ui:define>

</ui:composition>
